package com.mfp.java.testYou.db.mySql;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import com.mfp.java.testYou.core.utils.Utils;

public class MySQLConnect {
	
	public MySQLConnect(){
		
	}
	
	public static Connection startDBConnection() throws SQLException, IllegalAccessException, InstantiationException, ClassNotFoundException {
		String username = Utils.readConfig("config.properties", "db.user");
		String password = Utils.readConfig("config.properties", "db.pass");
		String url = Utils.readConfig("config.properties", "db.connectionString");
        Class.forName ("com.mysql.jdbc.Driver").newInstance();
        Connection conn = DriverManager.getConnection(url, username, password);
        return conn;
	}

}
